package com.mt.restaurant.entity.sale;

import javax.persistence.*;
import java.io.Serializable;
import com.mt.common.core.annotation.DColumn;
import com.mt.common.core.annotation.DEntity;
import com.mt.common.core.web.base.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;



import com.mt.restaurant.entity.material.Material;
import com.mt.restaurant.entity.sale.VegetableMenu;

@DEntity(label="菜谱材料关系",comment="",moduleLabel="销售管理")
@Entity(name="restaurant_menu_material_relation_ship")
@Table(name = "restaurant_menu_material_relation_ship" , indexes = { @Index(name = "index_menu_id", columnList = "menu_id"),@Index(name = "index_material_id", columnList = "material_id")  })
@ApiModel(description = "菜谱材料关系:")
public class MenuMaterialRelationShip extends BaseEntity implements Serializable{
	private static final long serialVersionUID = 1L;

	@DColumn(index=3,label="菜谱",foreignEntity="VegetableMenu",comment="",component="对象选择",where=false)
	@ApiModelProperty(value = "菜谱:")
	@Column(name="menu_id",length=255,nullable=false,unique=false)
	private Long menuId;

	@Transient
	private VegetableMenu menu;

	@Transient
	@ApiModelProperty(value = "菜谱名称:")
	@DColumn(index=3,label="菜谱",foreignEntity="VegetableMenu",comment="")
	private String menuName;

	@DColumn(index=4,label="数量",comment="",component="数字，小数",where=false)
	@ApiModelProperty(value = "数量:")
	@Column(name="amount",length=255,nullable=false,unique=false)
	private Double amount;

	@DColumn(index=5,label="材料",foreignEntity="Material",comment="",component="对象选择",where=false)
	@ApiModelProperty(value = "材料:")
	@Column(name="material_id",length=255,nullable=false,unique=false)
	private Long materialId;

	@Transient
	private Material material;

	@Transient
	@ApiModelProperty(value = "材料名称:")
	@DColumn(index=5,label="材料",foreignEntity="Material",comment="")
	private String materialName;

	@Transient
	private Double maxPrice;

	public Double getMaxPrice() {
		return maxPrice;
	}

	public void setMaxPrice(Double maxPrice) {
		this.maxPrice = maxPrice;
	}
	public Long getMenuId() {
		return this.menuId;
	}

	public void setMenuId(Long menuId) {
		this.menuId = menuId;
	}

	public Double getAmount() {
		return this.amount;
	}

	public void setAmount(Double amount) {
		this.amount = amount;
	}

	public Long getMaterialId() {
		return this.materialId;
	}

	public void setMaterialId(Long materialId) {
		this.materialId = materialId;
	}

	public VegetableMenu getMenu() {
		return this.menu;
	}

	public void setMenu(VegetableMenu menu) {
		if(menu == null){
		}
		else
		{
		this.menuId = menu.getEid();
		this.menu = menu;		
		}
}

	public String getMenuName() {
		return this.menuName;
	}

	public void setMenuName(String menuName) {
		this.menuName = menuName;
	}

	public Material getMaterial() {
		return this.material;
	}

	public void setMaterial(Material material) {
		if(material == null){
		}
		else
		{
		this.materialId = material.getEid();
		this.material = material;		
		}
}

	public String getMaterialName() {
		return this.materialName;
	}

	public void setMaterialName(String materialName) {
		this.materialName = materialName;
	}



}
